<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    693. Binary Number with Alternating Bits
   </h1>
   <p>
    Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.
   </p>
   <p>
    <b>
     Example 1:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> 5
<b>Output:</b> True
<b>Explanation:</b>
The binary representation of 5 is: 101
</pre>
   <p>
    <b>
     Example 2:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> 7
<b>Output:</b> False
<b>Explanation:</b>
The binary representation of 7 is: 111.
</pre>
   <p>
    <b>
     Example 3:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> 11
<b>Output:</b> False
<b>Explanation:</b>
The binary representation of 11 is: 1011.
</pre>
   <p>
    <b>
     Example 4:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> 10
<b>Output:</b> True
<b>Explanation:</b>
The binary representation of 10 is: 1010.
</pre>
  </div>
  <div>
   <h1 class="question_title">
    693. 交替位二进制数
   </h1>
   <p>
    给定一个正整数，检查他是否为交替位二进制数：换句话说，就是他的二进制数相邻的两个位数永不相等。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> 5
<strong>输出:</strong> True
<strong>解释:</strong>
5的二进制数是: 101
</pre>
   <p>
    <strong>
     示例 2:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> 7
<strong>输出:</strong> False
<strong>解释:</strong>
7的二进制数是: 111
</pre>
   <p>
    <strong>
     示例&nbsp;3:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> 11
<strong>输出:</strong> False
<strong>解释:</strong>
11的二进制数是: 1011
</pre>
   <p>
    <strong>
     &nbsp;示例 4:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> 10
<strong>输出:</strong> True
<strong>解释:</strong>
10的二进制数是: 1010
</pre>
  </div>
 </body>
</html>